﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EricBlog.Models;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace EricBlog.Controllers
{
    [Route("[controller]/[action]")]
    [ApiController]
    [EnableCors("any")]

    public class messageController : ControllerBase
    {
        private readonly Join _Join;
        public messageController(Join join)
        {
            _Join = join;
        }
        [HttpGet]
        public Array GetArticle()
        {
            var articles = _Join.message.Select(r => r).ToArray();
            return articles;
        }

    }
}
